Particle in a Box#
What you need to know
Particle in a Box (PIB) as a Model System
The Particle in a Box (PIB) is a simple model that helps illustrate the behavior of electrons confined within atoms and molecules. It serves as a useful tool to introduce key quantum concepts:
Energetic Quantization: Energy levels in quantum systems are discrete, not continuous, as seen in the PIB model.
Probabilistic Nature of Quantum Particles: The probability distribution for the particle’s position is non-uniform, with nodal points where the probability is zero, emphasizing the inherent uncertainty in the particle’s exact location.
Uncertainty Principle: There is an inverse relationship between the uncertainty in position and momentum, demonstrating the fundamental limit on how precisely both quantities can be known simultaneously.
Zero-Point Energy: Quantum particles always possess a minimum kinetic energy, even at absolute zero. This zero-point energy highlights the impossibility of freezing all motion in quantum systems.
Quantum-Classical Correspondence: As the system scales up, quantum behavior smoothly transitions to classical behavior, illustrating the correspondence principle.
Degeneracy of Energy Levels: In systems with symmetries, multiple wave functions can correspond to the same energy level, a phenomenon known as degeneracy.
Particle in a Box (PIB):#
Particle in a box is a toy model of electron/atom/molecule trapped in some region of space \([0,L]\). The positional information of a quantum “particle” is described by a quantum wave function \(\psi(x)\) which is obtained by solving Schrödinger equation a simple PDE/ODE or an eigenfunction-eigenvalue problem.
Wave functions are standing waves just like in a guitar on a string problem. With one major difference! Quantum-wave function has a probabilistic meaning and hence has a completely different meaning from a classical notion of a “wave”.
Classical vs Quantum particle in a box#
Fig. 51 The particle in a box (PIB) is a convenient system for illustrating the differences between classical (A) and quantum systems (B-F). The horizontal axis is position, and the vertical axis is the real part (blue) and imaginary part (red) of the wavefunction \(\psi_n(x)\). The states (B,C,D) are the eigenfunctions of Hamiltonian \(n=1,2,3\). While E and F are not.#
What are some new ideas that we learn from PIB#
In classical systems a particle trapped inside a large box can move at any speed within the box and it is no more likely to be found at one position than another. However, when the well becomes very narrow (on the scale of a few nanometers), quantum effects become important. The particle may only occupy certain positive energy levels.
“Particle” can never have zero energy, meaning that the particle can never “sit still”.
“Particle” is more likely to be found at certain positions than at others, depending on its energy level. The particle may never be detected at certain positions, known as spatial nodes.
Solving the Schrödinger Equation for the Particle in a Box (PIB)#
Fig. 52 Particle in a box subject to infinitely high potential walls#
The Schrödinger equation for a particle in a box (PIB) is defined by a Hamiltonian operator that incorporates the potential energy, which is infinitely large at the boundaries of the box and zero inside. This potential ensures that the particle is confined within the box, where it can only possess kinetic energy.
The potential energy for PIB is defined:
The boundary conditions are:
The Hamiltonian operator is in this case accounting only for kinetic energy!
Now, we have all the necessary ingredients to solve the time-independent Schrödinger equation for the 1D PIB:
Substituting the Hamiltonian, we get:
where the \(k^2\) is a positive real number that relates the particle’s energy \(E\) to its wavefunction.
Solution and Boundary Conditions#
Mathematically, the form of the 1D PIB problem is similar to the ordinary differential equation (ODE) used in the 1D vibrating guitar string problem. The key differences lie in the constant coefficients and the interpretation of the wavefunction.
The general solution to this differential equation is:
Applying the boundary condition \(\psi(0) = 0\), we find that \(A = 0\), leaving us with:
Applying the boundary condition \(\psi(L) = 0\), we get:
This condition is satisfied when:
Thus, the wavefunction becomes:
Using the relationship \(k^2 = \frac{n^2\pi^2}{L^2} = \frac{2mE}{\hbar^2}\), we can express the energy levels as:
The quantization of energy results from confining the wavefunction within a finite space. This is the reason bound states exhibit quantized energy levels. Atoms, molecules, and solids all possess discrete energy levels due to similar constraints.
Wavefunctions Must Be Normalized#
Next, we determine the constant coefficient \(B_n\) by enforcing the normalization condition:
To evaluate the integral, we use the trigonometric identity \(\sin^2(x) = \frac{1}{2}(1 - \cos(2x))=1\)
Since the integral of \(\cos\left(\frac{2n\pi x}{L}\right)\) over a full period from \(0\) to \(L\) is zero, we are left with:
Solving for \(B_n\) we determine normalization constant which ensures that square of wavefunction integrates to 1.
PIB Eigenfunctions and Eigenvalues#
Eigenfunctions and eigenvalues of 1D particle in a box
Full time dependent solution
Where the coefficients \(c_n\) depend on initial condition, e.g could be all zero except one (pure state) or a few of them non-zero (mixed state)
Visualize PIB solutions#
Pure states#
Below we visualize a few of the eigenfunctions \(n=1,2,3\) and its squares.
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
# Parameters
L = 1.0 # Length of the box
x = np.linspace(0, L, 1000) # Position values
# Define the wavefunction for a given quantum number n
def psi_n(n, x, L):
return np.sqrt(2 / L) * np.sin(n * np.pi * x / L)
# Define the square of the wavefunction
def psi_n_squared(n, x, L):
return psi_n(n, x, L)**2
# Quantum numbers to plot
n_values = [1, 2, 3]
# Create subplots for wavefunctions and their squares
fig, axs = plt.subplots(1, 2, figsize=(9, 3))
# Plot the wavefunctions
for n in n_values:
axs[0].plot(x, psi_n(n, x, L), label=f'n={n}')
axs[0].set_title('Wavefunctions for Particle in a Box')
axs[0].set_xlabel('Position x')
axs[0].set_ylabel(r'$\psi_n(x)$')
axs[0].legend()
axs[0].grid(True)
# Plot the squares of the wavefunctions
for n in n_values:
axs[1].plot(x, psi_n_squared(n, x, L), label=f'n={n}')
axs[1].set_title('Square of Wavefunctions for Particle in a Box')
axs[1].set_xlabel('Position x')
axs[1].set_ylabel(r'$|\psi_n(x)|^2$')
axs[1].legend()
axs[1].grid(True)
# Show the plots
plt.tight_layout()
plt.show()
Mixed states#
Below we visualize lienar combination of the first three eigenfunctions
We will pick \(c_1=c_2=c_3=1\) for simplicity. Will see that these coefficients determine contributions of each eigenfunction.
Notice that \(\psi^2\) can become time dependent if it contains mixtures of states but is time indepedent when it is in pure state becasue complex exponents cancel each other off: \(\psi_n(x)e^{-iEt/\hbar}\cdot \psi^{*}_n(x)e^{+iEt/\hbar}=|\psi_n(x)|^2\)
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from IPython.display import HTML
# Parameters
L = 1.0 # Length of the box
hbar = 1.0 # Set hbar = 1 for simplicity
m = 1.0 # Set mass = 1 for simplicity
n_states = [1, 2, 3] # Quantum numbers for the superposition
coeffs = [1, 1, 1] # Coefficients for the superposition
coeffs = np.array(coeffs) / np.sqrt(np.sum(np.array(coeffs) ** 2)) # Normalize coefficients
# Define spatial and time arrays
x = np.linspace(0, L, 200) # Reduce from 1000 to 500 points in space
t = np.linspace(0, 10, 200) # Reduce from 500 to 200 time step
# Define wavefunction for nth state
def psi_n(n, x, L):
return np.sqrt(2 / L) * np.sin(n * np.pi * x / L)
# Define energy for nth state
def energy_n(n, L):
return (n**2 * np.pi**2 * hbar**2) / (2 * m * L**2)
# Define time-dependent wavefunction
def psi_total(x, t, L, coeffs, n_states):
psi_t = np.zeros_like(x, dtype=complex)
for idx, n in enumerate(n_states):
psi_x = psi_n(n, x, L)
E_n = energy_n(n, L)
time_factor = np.exp(-1j * E_n * t / hbar)
psi_t += coeffs[idx] * psi_x * time_factor
return psi_t
# Set up the figure and axis
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(8, 10))
# Set limits for the wavefunction and wavefunction squared
ax1.set_xlim(0, L)
ax1.set_ylim(-2, 2)
ax2.set_xlim(0, L)
ax2.set_ylim(0, 4)
# Set labels for the wavefunction plot
ax1.set_xlabel('Position (x)', fontsize=14)
ax1.set_ylabel('Re[$\psi(x,t)$]', fontsize=14)
ax1.set_title('Time Evolution of Wavefunction', fontsize=16)
# Set labels for the squared wavefunction plot
ax2.set_xlabel('Position (x)', fontsize=14)
ax2.set_ylabel('$|\psi(x,t)|^2$', fontsize=14)
ax2.set_title('Probability Density', fontsize=16)
# Initialize the wavefunction and its square plots
line_real, = ax1.plot([], [], lw=2)
line_prob, = ax2.plot([], [], lw=2)
# Initialization function for the plot
def init():
line_real.set_data([], [])
line_prob.set_data([], [])
return line_real, line_prob
# Animation function which updates the plot each frame
def animate(i):
t_val = t[i]
psi = psi_total(x, t_val, L, coeffs, n_states)
psi_real = np.real(psi)
psi_squared = np.abs(psi)**2
line_real.set_data(x, psi_real)
line_prob.set_data(x, psi_squared)
return line_real, line_prob
# Create the animation
ani = FuncAnimation(fig, animate, init_func=init, frames=len(t), interval=50, blit=True)
plt.close(fig) # Prevents static display of the last frame
HTML(ani.to_jshtml())